//实现请求时防抖
const debounce = function(fn, delay = 500) {
    let timer = null;
    return function() {
        if (timer) {
            clearTimeout(timer)
        }
        const args = arguments
        timer = setTimeout(() => {
            fn.apply(this, args)
        }, delay);
    }
}

export { debounce }